<script setup xmlns:div="http://www.w3.org/1999/html">
import {ref} from 'vue';
// var msg='你好';
//绑定数据
const msg=ref("你好")
const htmlA=ref("<span style='color: red'>666</span>")
const bindA=ref("height:100px;width:100px;background-color:green;");

const num=ref("1");

const loginname=ref("未登录");

function clickA(){
  console.log('执行了A')
  //改变绑定数据
  msg.value="hello world";
  htmlA.value='<span style="color:pink">上山打老虎</span>'
  bindA.value='height:100px;width:100px;background-color:skyblue;'
}
</script>

<template>
  <span>消息是：{{msg}}</span>

  <div v-html='htmlA'></div>
  <button @click="clickA()">点击按钮</button>
  <div :style='bindA'></div>
  <button @click="num++">1</button>
  <span v-if="islogin" >张三</span>
  <span v-else>未登录</span>
</template>